#define DEBUG
#include <cstdio>
#include <cassert>
#define MODS 1000000007
#define MAXN 1000

using namespace std;

int main() {
#ifdef DEBUG
  freopen("3483.in", "r", stdin);
  freopen("3483.out", "w", stdout);
#endif

  static int a[MAXN+1], in[MAXN+1];
  static bool book[MAXN+1];
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i=1; i<=m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u<v ? in[u]++ : in[v]++;
  }
  for (int i=1; i<=n; i++) {
    int p=0;
    for (int j=0; j<=in[i]; j++) {
      for (p++; book[p]; p++);
    }
    a[i] = p;
    book[p]=true;
  }

  static long long f[MAXN+1];
  long long ans=0;
  for (int i=1; i<n; i++) {
    if (!f[i]) {
      f[i]=1;
    }
    bool flag=false;
    int temp=n+1;
    for (int j=i+1; j<=n; j++) {
      if (a[i]<a[j] && a[j]<temp) {
	flag = true;
	f[j] += f[i];
	temp = a[j];
      }
    }
    if (!flag) {
      ans += f[i];
    }
  }
  ans+=f[n];
  printf("%lld", ans%MODS);

  fcloseall();
  return 0;
}
